import http from "@/utils/http/index";

/**
 *  管理员查看全部人的会话 || 获取分派给我的会话
 * @param {Object} params - 参数对象
 *  */
export function assignAllCustomer(data) {
  return http({
    url: `/assign/all/${data.page}/${data.limit}`,
    method: "get",
    params: data,
  });
}

//  分派或者转接会话给其他客服
export function assignCustomer(data) {
  return http({
    url: "/assign/assign",
    method: "post",
    data: data,
  });
}

//  @客服
export function assignAt(data) {
  return http({
    url: "/assign/at",
    method: "post",
    data: data,
  });
}
//  @客服
export function assignMyList(data) {
  return http({
    url: `/assign/mylist/${data.page}/${data.limit}`,
    method: "get",
    params: data,
  });
}

//  删除分派给我的会话
export function removeAssignAt(data) {
  return http({
    url: `/assign/remove/${data.sessionId}`,
    method: "post",
    data: data,
  });
}

//  删除会话
export function removeAssign(data) {
  return http({
    url: `/sessin/deleteSession/${data.sessionId}`,
    method: "delete",
    data: data,
  });
}

//  会话评价
export function sessinAppraiset(data) {
  return http({
    url: `/sessin/appraise`,
    method: "post",
    data: data,
  });
}

//  设置会话完成状态
export function sessinComplete(data) {
  return http({
    url: `/sessin/complete`,
    method: "post",
    data: data,
  });
}

//  转人工
export function sessinManual(data) {
  return http({
    url: `/sessin/manual`,
    method: "post",
    data: data,
  });
}

//  设置会话托管状态

export function trusteeship(data) {
  return http({
    url: `/sessin/trusteeship`,
    method: "post",
    data: data,
  });
}

//  发送群消息 || 内部回复，匿名回复
export function SendGroupMessage(data) {
  return http({
    url: `/sessin/SendGroupMessage`,
    method: "post",
    data: data,
  });
}
//  发送系统消息
export function SendGroupSystemNotification(data) {
  return http({
    url: `/sessin/SendGroupSystemNotification`,
    method: "post",
    data: data,
  });
}
//  获取会话详情
export function getUserMessageBySessionId(data) {
  return http({
    url: `/sessin/ession/detail/${data.sessionId}`,
    method: "get",
  });
}
//  获取今日统计

export function getTodayStatistics(data) {
  return http({
    url: `/index/getTodayStatistics`,
    method: "get",
  });
}
//  强制下线

export function Kick(data) {
  return http({
    url: `/index/Kick`,
    method: "get",
    params: data,
  });
}

//  今日对话和访客趋势
export function GetVisitorAndSessionStatistics(data) {
  return http({
    url: `/index/GetVisitorAndSessionStatistics`,
    method: "get",
  });
}

//  监控
export function GetTodayKefuStatistics(data) {
  return http({
    url: `/index/GetTodayKefuStatistics/${data.page}/${data.limit}`,
    method: "get",
    params: data,
  });
}
//  生成链接
export function addSessionLink(data) {
  return http({
    url: `/sessionLink/AddLink`,
    method: "post",
    data: data,
  });
}
//  绑定公众号| 小程序
export function getComponentLoginPage(data) {
  return http({
    url: `/weixinconfig/getComponentLoginPage?authType=${data.authType}`,
    method: "get",
    data: data,
  });
}
//  获取公众号| 小程序
export function GetBindList(data) {
  return http({
    url: `/weixinconfig/GetBindList}`,
    method: "get",
    data: data,
  });
}
